<%@page import="com.shsh.safemanage.model.Equipment"%>
<%@page import="java.util.List"%>
<%@page import="com.shsh.safemanage.util.Constants"%>
<%@page import="com.shsh.safemanage.dao.DaoCreator"%>
<%@page import="com.shsh.safemanage.dao.EquipmentDao"%>
<%@page import="com.shsh.safemanage.model.User"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<%
{
User loginUser = (User) session.getAttribute(Constants.SESSION_USER);
EquipmentDao equipmentDao = DaoCreator.createEquipmentDao();

List<Equipment> equipList = equipmentDao.getUserMappingEquipmentList(loginUser.getId(), false);
Equipment equip = (Equipment) session.getAttribute(Constants.SESSION_PROBLEM_EQUIPMENT);
%>
<span style="margin-left: 40px" class="span1">通知人：</span>
<%
	if (equipList.size() > 0 || equip != null) {
		Long equipID = equipList.get(0).getId();
		if (equip != null) {
			equipID = equip.getId();
		}
		List<User> userList = equipmentDao.getEquipmentMappingUser(equipID);
		StringBuffer equipLeadersStr = new StringBuffer();
		for (int i = 0; i < userList.size(); i++) {
			if (i == 0) {
				equipLeadersStr.append(userList.get(i).getName());
			} else {
				equipLeadersStr.append(",");
				equipLeadersStr.append(userList.get(i).getName());
			}
		}
%>
<input type="text" id="informedPerson" size="40" readonly="readonly"
	value="<%=equipLeadersStr%>" style="background-color: CCCCFF;" />
<%
	}
}
%>